
package com.google.code.sms.android.util;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ViewFlipper;

/**
 * Work-around for Android Issue 6191 (http://code.google.com/p/android/issues/detail?id=6191)
 *
 * @author Sindre Mehus
 * @version $Id: MyViewFlipper.java 1775 2010-08-23 10:16:23Z sindre_mehus $
 */
public class MyViewFlipper extends ViewFlipper {

    public MyViewFlipper(Context context) {
        super(context);
    }

    public MyViewFlipper(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    protected void onDetachedFromWindow() {
        try {
            super.onDetachedFromWindow();
        }
        catch (IllegalArgumentException e) {
            // Call stopFlipping() in order to kick off updateRunning()
            stopFlipping();
        }
    }
}

